package org.viva.action;

import javax.annotation.Resource;
import javax.servlet.http.HttpServletRequest;

import org.springframework.stereotype.Controller;
import org.springframework.ui.ModelMap;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RequestMethod;
import org.viva.core.util.DeviceUtils;
import org.viva.service.sys.WebsiteCache;
import org.viva.service.sys.WebsiteService;

@Controller
public class IndexAction {

    @Resource
    private WebsiteService websiteService;

    @RequestMapping(value = "/", method = RequestMethod.GET)
    public String index(HttpServletRequest request, ModelMap modelMap) {
//        WebsiteCache.getConfig().put("cms_temppath", "t2");
//        WebsiteCache.getConfig().put("cms_respath", "t2");
        modelMap.put("ws", WebsiteCache.getConfig());
        String cms_temppath = WebsiteCache.get("cms_temppath");
//        if (DeviceUtils.isMobileDevice(request)) {
//            return cms_temppath + "/index_m";
//        }
        return cms_temppath + "/index";
    }

}
